import request from '@/utils/request'
import qs from 'qs'


export function pageUnit(current,limit) {
  return request({
    url: `/manager/pageUnit/${current}/${limit}`,
    method: 'get'
  })
}


export function getAllUnit() {
  return request({
    url: `/manager/getAllUnit`,
    method: 'get'
  })
}


export function getUnitById(id) {
  return request({
    url: `/manager/getUnitById/${id}`,
    method: 'get'
  })
}


export function saveUnit(params) {
  return request({
    url: `/manager/saveUnit`,
    method: 'post',
    data: qs.stringify(params)
  })
}


export function deleteUnitById(id) {
  return request({
    url:  `/manager/deleteUnitById/${id}`,
    method: 'delete'
  })
}


export function updateUnit(params) {
  return request({
    url: `/manager/updateUnit`,
    method: 'post',
    data: qs.stringify(params)
  })
}